package com.example.demo_1;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import com.example.demo_1.Stu;
import com.example.demo_1.StuService;

@Service
public class StuServiceIml implements StuService{
    JdbcTemplate jdbcTemplate;

    public StuServiceIml(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    @Override
    public int addStu(Stu mess) {
        String sql = "insert into mess (id, name,age) values (?,?,?)";
        return jdbcTemplate.update(sql,mess.getId(),mess.getName(),mess.getAge());
    }


    public int deleteStu(int id){return 0;}

    @Override
    public Stu findStu(int id) {
        return null;
    }

    public int updateStu(Stu mess){return 0;}
}
